﻿<?php

	include "DAO.php";
        
	$query = createArtikelQuery();
        
        $result = dbGetResult($query);
        
	$counterOut = 0;

	while ( $row = mysql_fetch_assoc( $result ) ){				
			
		$id = $row['id'];
		$artist = $row['izvajalec'];
		$album = $row['album'];
		$description = $row['opis'];
		$price = $row['cena'];
		$image = $row['slika'];	
		if (isset($_GET["type"]))
			$tp = $_GET["type"];
		else
			$tp = "everything";
											
		if ($counterOut%2 != 0)	{
			print ("<div class=\"cnt\"><div class=\"product\"><img src=\"$image\" class=\"productpic\" alt=\"$artist\" />".
			"<div class=\"description\">".
			"<h4>$artist</h4><br/>".
			"<h5>$album</h5><br/>".
			"<p>$description</p>".
			"<h3>$$price</h3><a href=\"#\"><div class=\"ply\"><img src=\"play2.png\" class=\"playit2\" alt=\"play\" /></div></a>".
			"<a href=\"./index.php?call=cart&id=$id&type=$tp\"><div class=\"ply\"><img src=\"buyitnovo.jpg\" class=\"buyit\" alt=\"buy it\" /></div></a>".
			"</div></div></div>||");
		}
		else {
			print ("<div class=\"cnt\"><div class=\"product2\"><img src=\"$image\" class=\"productpic\" alt=\"$artist\" />".
			"<div class=\"description\">".
			"<h4>$artist</h4><br/>".
			"<h5>$album</h5><br/>".
			"<p>$description</p>".
			"<h3>$$price</h3><a href=\"#\"><div class=\"ply\"><img src=\"play1.png\" class=\"playit1\" alt=\"play\" /></div></a>".
			"<a href=\"./index.php?call=cart&id=$id&type=$tp\"><div class=\"ply\"><img src=\"buyitnovo.jpg\" class=\"buyit\" alt=\"buy it\" /></div></a>".
			"</div></div></div>||");
		}
		$counterOut += 1;
	} 
?>